package springboottest.springboot.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import springboottest.springboot.dao.UserMapper;
import springboottest.springboot.entity.UserEntity;
import springboottest.springboot.service.SpringBootService;

@Service
public class SpringBootServiceImpl implements SpringBootService {

	@Override
	public String hello(String arg) {

		return "hello service:" + arg;
	}

	@Autowired
	UserMapper userMapper;

	@Override
	public UserEntity findUserEntityByUserId(Long userId) {
		if (null == userId) {
			return new UserEntity(0L, "未走数据库");
		}
		return userMapper.findUserByUserId(userId);
	}

}
